Fast Algorithms for the Constrained Longest Increasing Subsequence Problems
نویسندگان
چکیده
Let 〈a1, a2, . . . , an〉 be a sequence of comparable elements. In this paper, we study two constrained versions of the longest increasing subsequence (LIS) problem. The first problem is the range-constrained longest increasing subsequence (RLIS) problem. Given 0 < LI ≤ UI < n and 0 ≤ LV ≤ UV , the objective of the RLIS problem is to deliver a maximum-length increasing subsequence 〈ai1 , ai2 , . . . , ail〉 satisfying LI ≤ ik+1 − ik ≤ UI and LV ≤ aik+1 − aik ≤ UV for all 1 ≤ k < l. We give an O(n log(UI−LI))-time and O(n)-space algorithm for solving the RLIS problem. The second problem is the slope-constrained longest increasing subsequence (SLIS) problem. Given a nonnegative slope m, the objective of the SLIS problem is to obtain a maximum-length increasing subsequence 〈ai1 , ai2 , . . . , ail〉 satisfying aik+1−aik ik+1−ik ≥ m for all 1 ≤ k < l. Our algorithm for the SLIS problem runs in O(n log r) time and O(n) space, where r is the length of an SLIS.
منابع مشابه
A simple algorithm for the constrained sequence problems
In this paper we address the constrained longest common subsequence problem. Given two sequences X , Y and a constrained sequence P , a sequence Z is a constrained longest common subsequence for X and Y with respect to P if Z is the longest subsequence of X and Y such that P is a subsequence of Z. Recently, Tsai [7] proposed an O(n ·m · r) time algorithm to solve this problem using dynamic prog...
متن کاملAlgorithms for the Constrained Longest Common Subsequence Problems
Given strings S1, S2, and P , the constrained longest common subsequence problem for S1 and S2 with respect to P is to find a longest common subsequence lcs of S1 and S2 such that P is a subsequence of this lcs. We present an algorithm which improves the time complexity of the problem from the previously known O(rnm) to O(rnm) where r, n, and m are the lengths of P, S1, and S2, respectively. As...
متن کاملFast algorithm for constrained longest common subsequence problem
The problem of finding the constrained longest common subsequence (CLCS) for the sequences A and B with respect to the sequence P was introduced recently. The best known algorithms for its solving requires time of order of a product of the sequences length. We introduce a novel approach in which time and memory complexities depends on the number of matches between A, B, and P . The time complex...
متن کاملA Load Balancing Technique for Some Coarse-Grained Multicomputer Algorithms
The paper presents a load balancing method for some CGM (Coarse-Grained Multicomputer) algorithms. This method can be applied on different dynamic programming problems such as: Longest Increasing Subsequence, Longest Common Subsequence, Longest Repeated Suffix Ending at each point in a word and Detection of Repetitions. We present also experimental results showing that our method is efficient.
متن کاملOn Some Variants of the Longest Increasing Subsequence Problem
The problem of finding a longest increasing subsequence (LIS) is a well known task in sequence processing. There are many variants of the basic task. We discuss a recently introduced variant of LIS, a minimal height longest increasing subsequence problem and propose a new algorithm for it, which improves its time complexity. Moreover, we define a family of similar problems and introduce algorit...
متن کامل